//
// Created by lenovo on 2024/1/11.
//

#ifndef CALCULATOR_EXPORT_H
#define CALCULATOR_EXPORT_H

#include "import.h"
#include <string>
#include <utility>
#include <vector>

class Translator{
public :
    Evaluable* result() ;
    Translator(
            std::string s ,
            std::map<std::string ,Functions::iFunction*>* _map,
            std::vector<std::set<std::string> >* prio = &Priority::OptPrio
    )
            : material(std::move(s)), priority(prio) , _identified_funcs(_map)
    {}

protected:
    void translate() ;
    bool _done {false};
    std::vector<std::string> words ;
    std::vector<token*> tokens ;
    std::string material ;
    Evaluable* _result{} ;
    std::vector< std::set<std::string> >* priority {nullptr} ;//定义了运算符的优先级
    std::map< std::string , Functions::iFunction*>* _identified_funcs {nullptr};//需要用到的函数
};



#endif //CALCULATOR_EXPORT_H
